/*
 * @description:请求Spu列表返回的数据结构
 * */

// 单个spu的数据类型
export interface SpuListItmeType {
    id?: number;
    spuName: string;
    description: string;
    category3Id: number;
    tmId: number;
    spuSaleAttrList: null;
    spuImageList: null;
}

// spu列表的数据类型
export type SpuListType = SpuListItmeType[];

// 请求spu列表返回的数据类型
export interface SpuPageListType {
    records: SpuListType;
    total: number;
    size: number;
    current: number;
    searchCount: boolean;
    pages: number;
}

/*
 * @description:添加Spu和修改Spu的数据结构
 * */

// spuImageItem的数据类型
export interface SpuImageItemType {
    id?: number;
    imgName: string;
    imgUrl: string;
    spuId?: number;
    name?: string;
    url?: string;
    isDefault?: string;
}

// spuImageList的数据类型
export type SpuImageListType = SpuImageItemType[];

// spuSaleAttrValueItem的数据类型
export interface SpuSaleAttrValueItemType {
    baseSaleAttrId: number;
    id?: number;
    isChecked: string;
    saleAttrName: string;
    saleAttrValueName: string;
    spuId: number;
}

// spuSaleAttrValueList的数据类型
export type SpuSaleAttrValueListType = SpuSaleAttrValueItemType[];

// spuSaleAttrItem的数据类型
export interface SpuSaleAttrItemType {
    baseSaleAttrId: number;
    id?: number;
    saleAttrName: string;
    spuId?: number;
    spuSaleAttrValueList: SpuSaleAttrValueListType;
    isEdit?: boolean;
    inputValue?: string;
    saleAttrIdValueId?: string; // 用于收集数据
}

// spuSaleAttrList的数据类型
export type SpuSaleAttrListType = SpuSaleAttrItemType[];

// 添加spu和修改Spu的数据类型
export interface SpuInfoType {
    category3Id: number;
    description: string;
    id?: number;
    spuImageList: SpuImageListType;
    spuName: string;
    spuSaleAttrList: SpuSaleAttrListType;
    tmId: number;
}

/*
 * @description:销售属性的数据结构
 * */

// 销售属性的数据类型
export interface BaseSaleAttrType {
    id: number;
    name: string;
}

// 销售属性列表的数据类型
export type BaseSaleAttrListType = BaseSaleAttrType[];
